package entities;

import java.io.Serializable;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="staff")
@DiscriminatorValue("staff")
public class Staff extends User implements Serializable {

	private static final long serialVersionUID = 1L;
	
    @ManyToOne
	private Team team;

    private String typeStaff;

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public String getTypeStaff() {
		return typeStaff;
	}

	public void setTypeStaff(String typeStaff) {
		this.typeStaff = typeStaff;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((team == null) ? 0 : team.hashCode());
		result = prime * result
				+ ((typeStaff == null) ? 0 : typeStaff.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Staff other = (Staff) obj;
		if (team == null) {
			if (other.team != null)
				return false;
		} else if (!team.equals(other.team))
			return false;
		if (typeStaff == null) {
			if (other.typeStaff != null)
				return false;
		} else if (!typeStaff.equals(other.typeStaff))
			return false;
		return true;
	}
}